<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3">用户侧接口列表</h1>
</div>

<div class="panel panel-default">

  <!--  按钮  -->
  <div class="panel-heading">
    <div class="row">
      <div class="col-sm-6  ">
        <button class="btn m-b-xs w-xs btn-success" ng-click="search(1)">搜索</button>
      </div>
    </div>
  </div>

  <!--  搜索框  -->
  <div class="row wrapper" >
    <div class="col-sm-3 m-b-xs">
      <div class="input-group" >
        <div class="input-group-btn" >
          <span class="btn btn-default">用户侧接口</span>
        </div>
        <ui-select ng-model="searchform.type" theme="bootstrap">
          <ui-select-match placeholder="选择">{{$select.selected.label}}</ui-select-match>
          <ui-select-choices repeat="item in item_set.type | filter: $select.search">
            <span ng-bind-html="item.label"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>

    <div class="col-sm-4 m-b-xs">
      <div class="input-group" >
        <div class="input-group-btn" >
          <span class="btn btn-default">模块编码</span>
        </div>
        <ui-select ng-model="searchform.center" theme="bootstrap">
          <ui-select-match placeholder="选择center...">{{$select.selected.label}}</ui-select-match>
          <ui-select-choices repeat="item in item_set.center_list | filter: $select.search">
            <span ng-bind-html="item.label"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>

    <div class="col-sm-5 m-b-xs">
      <div class="input-group" >
        <div class="input-group-btn" >
          <span class="btn btn-default">URL</span>
        </div>
        <input type="text" class="form-control ng-pristine ng-valid ng-touched" ng-model="searchform.url">
      </div>
    </div>
  </div>

  <!--  数据表格  -->
  <table class="table table-striped table-bordered ng-isolate-scope dataTable no-footer" 
    style="display: table; width: 100%;table-layout:fixed;">
    <thead>
      <tr>
        <th style="width: 20%;text-align:center;">接口地址</th>
        <th style="width: 5%;text-align:center;">状态</th>
        <th style="width: 5%;text-align:center;">登录类型</th>
        <th style="width: 9%;text-align:center;">说明</th>
        <th style="width: 7%;text-align:center;">更新时间</th>
        <th style="width: 6%;text-align:center;">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="info in apiList">
        <td>{{info.id}}<br />{{info.url}}</td>
        <td class="text-center">{{info.state == 0?'可用':'不可用'}}</td>
        <td class="text-center"><div ng-if="info.state==0">{{info.type==0?'无需登录':'需要登录'}}</div></td>
        <td>
          <div style="overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">
            {{info.name}}
          </div>
        </td>
        <td class="text-center">{{info.update_date}}</td>
        <td>
          <button ng-if="item_set.btn" type="button" class="btn btn-primary btn-xs" ng-click="update($index,true)">启用</button>
          <div ng-if="!item_set.btn" >
            <button type="button" class="btn btn-info btn-xs" ng-click="update($index,false)">修改</button>
            <button type="button" class="btn btn-danger btn-xs" ng-click="delete($index)">删除</button>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
  
  <div class="text-right" style="background-color: white">
    <pagination total-items="totalItems" ng-model="currentPage" ng-change="changePage()" previous-text="上一页" next-text="下一页"
      first-text="首页" last-text="尾页" max-size="5" boundary-links="true" rotate="false" items-per-page="itemsPerPage"
      class="m-t-none m-b"></pagination>
  </div>
  
</div>

